package com.mes.cloud.web;

import com.mes.cloud.api.dto.request.SysGlobalLogConfigureAddRequest;
import com.mes.cloud.api.dto.request.SysGlobalLogConfigureRequest;
import com.mes.cloud.api.dto.request.SysGlobalLogConfigureUpdateRequest;
import com.mes.cloud.api.dto.response.SysGlobalLogConfigureDto;
import com.mes.cloud.common.JsonResult;
import com.mes.cloud.service.SysGlobalLogConfigureService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiImplicitParam;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import javax.validation.Valid;
import java.util.List;

/**
 * @author xy
 * @email yuan.xue3@pactera.com
 * @version 2019-11-13 09:53:12
 */
@Api(tags = "全局日志配置表", value = "全局日志配置表接口")
@RestController
@RequestMapping(value = "/sysGlobalLogConfigure")
public class SysGlobalLogConfigureController  {

    private SysGlobalLogConfigureService sysGlobalLogConfigureService;

    @Autowired
    public SysGlobalLogConfigureController(SysGlobalLogConfigureService sysGlobalLogConfigureService) {
        this.sysGlobalLogConfigureService = sysGlobalLogConfigureService;
    }

    /**
     * 功能: 全局日志配置表查询所有
     *
     * @param sysGlobalLogConfigureRequest
     * @return JsonResult<List<SysGlobalLogConfigureDto>>
     */
    @ApiOperation(value = "全局日志配置表查询所有", notes = "全局日志配置表查询所有")
    @PostMapping(value = "/list")
    public JsonResult<List<SysGlobalLogConfigureDto>> list(@RequestBody SysGlobalLogConfigureRequest sysGlobalLogConfigureRequest) {
        return  sysGlobalLogConfigureService.list(sysGlobalLogConfigureRequest);
    }

    /**
     * 功能: 全局日志配置表新增
     *
     * @param sysGlobalLogConfigureAddRequest
     * @return JsonResult
     */
    @ApiOperation(value = "全局日志配置表新增", notes = "全局日志配置表新增")
    @PostMapping(value = "/add")
    public JsonResult<String> add(@Valid @RequestBody SysGlobalLogConfigureAddRequest sysGlobalLogConfigureAddRequest) {
        return sysGlobalLogConfigureService.add(sysGlobalLogConfigureAddRequest);
    }

    /**
     * 功能: 全局日志配置表修改
     *
     * @param sysGlobalLogConfigureUpdateRequest
     * @return JsonResult
     */
    @ApiOperation(value = "全局日志配置表修改", notes = "全局日志配置表修改")
    @PostMapping(value = "/update")
    public JsonResult update(@Valid @RequestBody SysGlobalLogConfigureUpdateRequest sysGlobalLogConfigureUpdateRequest) {
        return sysGlobalLogConfigureService.update(sysGlobalLogConfigureUpdateRequest);

    }

    /**
     * 功能: 全局日志配置表删除
     *
     * @param id
     * @return JsonResult
     */
    @ApiOperation(value = "全局日志配置表删除", notes = "全局日志配置表删除")
    @ApiImplicitParam(paramType = "Long", name = "id", value = "全局日志配置表主键", required = true)
    @GetMapping(value = "delete/{id}")
    public JsonResult delete(@PathVariable String id) {
        return sysGlobalLogConfigureService.delete(id);

    }

    /**
     * 功能: 全局日志配置表查看详情
     *
     * @param id
     * @return JsonResult
     */
    @ApiOperation(value = "全局日志配置表查看详情", notes = "全局日志配置表查看详情")
    @ApiImplicitParam(paramType = "Long", name = "id", value = "全局日志配置表主键", required = true)
    @GetMapping(value = "get/{id}")
    public JsonResult<SysGlobalLogConfigureDto> get(@PathVariable String id) {
        return sysGlobalLogConfigureService.get(id);
    }

    @ApiOperation(value = "查询", notes = "查询")
    @PostMapping(value = "/getSysGlobalLogConfigure")
    public JsonResult<SysGlobalLogConfigureDto> getSysGlobalLogConfigure(@Valid @RequestBody SysGlobalLogConfigureRequest sysGlobalLogConfigureRequest) {
        return sysGlobalLogConfigureService.getSysGlobalLogConfigure(sysGlobalLogConfigureRequest);
    }

}
